{template header}


{template sidebar}

<!-- artile begin -->
<div class="article">
{template title}

<!--{if  $a == 'index'  }-->
    <table cellpadding="1" cellspacing="1" width="100%" border="0">
        <tr>

            <th  style="text-align: center" colspan="6">库存点信息</th>
        </tr>
        <tr>

            <th width="20%">库存编号</th>
            <th width="15%">库存名称</th>
            <th width="15%">所在地</th>
            <th width="15%">联系人</th>
            <th width="15%">电话</th>
            <th width="15%">操作</th>
        </tr>
        <!--{if $res}-->
        <!--{loop $res $val}-->
        <tr>

            <td>{$val['stockNo']}  </td>
            <td>{$val['stockName']}</td>
            <td>{$val['stockAddr']}</td>
            <td>{$val['name']}</td>
            <td>{$val['phone']}</td>
            <td class="operate">
                <a href="{$this->url($c,'editStock',array('stockNo'=>$val['stockNo']))}">编辑</a>
                <a title="删除商品" class="del" href="{$this->url($c,'del',array('stockNo'=>$val['stockNo']))}">删除</a>
            </td>

        </tr>
        <!--{/loop}-->
        <!--{else}-->
        <tr>
            <td colspan="6">没有数据记录！</td>
        </tr>
        <!--{/if}-->

        <tr>
            <td colspan="6" class="td6">
                <a title="新增库存" class="btn btn-success " id="addGoods"  href="{$this->url($c,'addStock')}">新增库存</a>
            </td>
        </tr>

    </table>
</form>

<!--{/if}-->


<!--{if $a ==  'addStock' ||  $a =='editStock' }-->
<form method="post" action="{$this->url($c, 'saveStockInfo', array('stockNo' => $result['stockNo'],'type' => $type) )}">
    <table cellpadding="1" cellspacing="1" width="100%" border="0">
        <tr>
            <th colspan="3">库存点设置</th>

        </tr>
        <tr>
            <td class="td1">库存编号：</td>
            <td class="td2" colspan="2">
                <input type="text" name="stockNo" value="{$a == 'editStock'? $result['stockNo']  : '' }"  />
            </td>

        </tr>
        <tr>
            <td class="td1">库存名称：</td>
            <td class="td2" colspan="4">
                <input type="text" name="stockName" value="{$a == 'editStock'? $result['stockName']  : '' }"  />
            </td>

        </tr>
        <tr>
            <td class="td1">所在地：</td>
            <td class="td2" colspan="2">
                <input type="text" name="stockAddr" value="{$a == 'editStock'  ? $result['stockAddr'] : ''} "/>
            </td>

        </tr>
        <tr>
            <td class="td1">所辖区域：</td>
            <td class="td2" colspan="2">
                <!--{loop $this->area $k $v}-->
                <!--{if  $k % 6==0 }-->
                <br>
                <!--{/if}-->

                <input type="checkbox"  name="area[]" value="{$k}" {echo true== in_array($k,$result['area']) ? 'checked':''} />{$v} &nbsp;  &nbsp; &nbsp;

                <!--{/loop}-->

            </td>

        </tr>
        <tr>
            <td class="td1">联系人：</td>
            <td class="td2" colspan="2">
                <select name="personId"   >
                    <!--{loop $res  $val}-->
                    <option value="{$val['id']}" {echo $result['personId']  == $val['id'] ? selected : ''}  />{$val['name']}</option>
                    <!--{/loop}-->
                </select>
            </td>
        </tr>
        <tr>
            <td  colspan="3" class="td2" style="text-align: center">
                <a title="保存" class="btn btn-success save" href="{$this->url($c)}">保 存</a>
            </td>

        </tr>
    </table>
</form>
<!--{/if}-->










</div>
<!-- artile end -->
{template footer}
